import React, { Component } from 'react'
import { connect } from 'react-redux';
import actions from '../store/actions/counter'
class Counter extends Component {
    render(){
        
        return(
            <div>
                <button onClick={()=>{this.props.subtraction(1)}}>-</button>
                <span>{this.props.num}</span>
                <button onClick={()=>{this.props.addition(1)}}>+</button>
            </div>
        )
    }
}
export default connect(state=>({num:state.counter}), actions)(Counter)